<script setup>
import {articleGetChannelsService} from '@/api/article'
import { onMounted, ref } from 'vue';
const chanelList = ref([])
const getChannelList = async ()=>{
    const res = await articleGetChannelsService()
    chanelList.value = res.data.data
    // console.log(chanelList.value);
    
}
onMounted(()=>{
    getChannelList()
})

defineProps({
    moduleValue:{
        type:[Number,String]
    },
    width:{
        type:String
    }
})

const emit = defineEmits(['update:moduleValue'])
</script>


<template>
    <el-select style="width: 200px" :moduleValue="moduleValue" @update:moduleValue="emit('update:moduleValue',$event)" :style="{width}">
        <!-- label向用户展示，value用于提交后台 -->
        <el-option
        v-for="item in chanelList"
        :key="item.id" 
        :label="item.cate_name" 
        :value="item.id"
        >
        </el-option>
        <el-option 
        label="体育" 
        value="0245"
        >
        </el-option>
    </el-select>
</template>